from heima_toutiao import app,db
# 1.先设置flask-script的集成---传入我们的app
from flask_script import Manager
manager = Manager(app)
# 2.再集成 Flask-Migrate
from flask_migrate import Migrate, MigrateCommand
# Migrate(app=None, db=None, directory='migrations')
Migrate(app=app,db=db)
# manager.add_command(1.命令实例,2.命令名字)
manager.add_command('db',MigrateCommand)
if __name__ == '__main__':
    manager.run()
